<?php include_once("header.html")?>
<script src="<?php echo $www_site_url?>/public/js/calendar.js" type="text/javascript"></script>
<div id="append"></div>
<div id="wrap">  <br />

<?php include_once("hometotal_left.html")?>
<div class="admincontent">

<div id="tabsD" style="width:100%">
  <ul>
   <li style="float:right;"><?php echo lang("select_brand")?>:<input name="selbrand" type="text" class="ClocationInput" onclick="showmitibrands();" id="selbrand" value="<?php if($brand){ echo splitx($brand['b_name']); }?>" /></li>
  </ul>
</div>
<br />

<div id="brandlist" style="width: 170px; border: 1px solid #B5CFD9; background:#fefefe;display:none; position:absolute;z-index:999;">
  <ul>
  <?php
       if(isset($brands) && is_array($brands)){
         foreach ($brands as $b){
                ?>
	<li style="padding:2px;"> <label><a href="/client.php?action=hometotal&view=assignment&selbrands=<?php echo $b['b_id']?>"><?php echo splitx($b['b_name']);?></a></label></li>
	  <?php
			}
      }
       ?>
     </ul>
</div>

<form action="/client.php" method="GET" name="seachfrm">
 <input name="action" type="hidden" value="hometotal"  />
 <input name="view" type="hidden" value="assignment"  />
 <input name="stores" type="hidden" value="<?php echo $type?>"  />
 <input name="cs_id" type="hidden" id="cs_id" value="<?php echo $cs_id;?>" />

<div id="storelist" style="width: 210px; border: 1px solid #B5CFD9; background:#fefefe;display:none; position:absolute;z-index:150;">
  <ul>
  <?php
       if(isset($stores) && is_array($stores)){
         foreach ($stores as $s){
                ?>
	<li style="padding:2px;"><a onclick="selectstore('<?php echo $s['cs_id']."|".$s['cs_name'];?>');return false;" href="#"><?php echo splitx($s['cs_name']);?></a></li>
	  <?php
			}
      }
       ?>
     </ul>
</div>
<table width="100%" height="50" border="0" cellpadding="0" cellspacing="0" class="clear">
  <tr>
    <td class="CsearchLeft">&nbsp;</td>
    <td align="center" class="CsearchCenter">
     <?php echo lang("select_brand")?>:
    <input name="selstore" type="text" class="ClocationInput" onclick="showstores();" id="selstore" value="<?php if(empty($selstore)) echo "--"; else echo splitx($selstore);?>" />

      <?php echo lang("a_sdate")?>：
      <input name="sdate" type="text" class="CtimeInput" id="sdate" value="<?php echo $sdate;?>" onclick="showcalendar();"/>
      <?php echo lang("a_edate")?>：
      <input name="edate" type="text" class="CtimeInput" id="edate" value="<?php echo $edate;?>" onclick="showcalendar();" />
      <input name="button" type="submit" class="btnblue" id="button" value="<?php echo lang("submit")?>" /></td>
    <td class="CsearchRight">&nbsp;</td>

  </tr>
</table>
</form>
<br />
<br />
 <table width="100%" border="0" cellpadding="0" cellspacing="1" class="historyMission">
                <tr>
                  <td class="title"><?php echo lang("finish_date")?></td>
                  <td class="title"><?php echo lang("brands")?></td>

                  <td class="title"><?php echo lang("stores")?></td>
                  <td class="title"><?php echo lang("assignment")?>/<?php echo lang("report")?></td>
                  <td class="title"><?php echo lang("income")?>（<?php echo lang("income_unit")?>）</td>
                </tr>
                <?php
              if(isset($myassignment['records'])&& is_array($myassignment['records'])){
							foreach ($myassignment['records'] as $k=>$v){?>
                <tr>
                  <td><?php echo substr( $v['a_fdate'],0,10);?></td>
                  <td><?php echo splitx($v['c_title'])?></td>

                  <td><?php echo splitx($v['cs_name'])?></td>
                  <td><a href="/client.php?action=hometotal&view=reportcomplete&re_id=<?php echo $v['re_id']?>&a_id=<?php echo $v['a_id']?>"><?php echo splitx($v['a_title']);?></a></td>
                  <td><?php echo $v['a_cost']?></td>
                </tr>
             <?php }}?>
              </table>
         <br />
          <?php if(!empty( $myassignment['pagebar'])){?><div class="pages"><?php echo $myassignment['pagebar']?></div><?php }?>

</div>

</div>


<?php include_once("footer.html")?>
